<template>
  <div class="button">
    <button>新增班级</button>
  </div>
  <div class="classShow">
    <div class="list">
      <el-row :gutter="20" style="width: 100%; height: 40px; display: flex; align-items: center">
        <el-col :span="6"> </el-col>
        <el-col :span="6"> 班级名称 </el-col>
        <el-col :span="6"> 班主任 </el-col>
        <el-col :span="6"> 班级总人数 </el-col>
      </el-row>
      <div class="item" v-for="item in dataList" :key="item.id">
        <el-row :gutter="20" style="width: 100%">
          <el-col :span="6">
            <div class="icon">
              <el-icon>
                <ArrowRight />
              </el-icon>
            </div>
          </el-col>
          <el-col :span="6">
            <div class="className">{{ item.className }}</div>
          </el-col>
          <el-col :span="6">
            <div class="teacherName">{{ item.teacherName }}</div>
          </el-col>
          <el-col :span="6">
            <div class="totalPeople">{{ item.totalPeople }}</div>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ArrowRight } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const dataList = ref([
  {
    id: 'about',
    className: '计网一班',
    teacherName: '孙鸣',
    totalPeople: 72,
  },
])
</script>

<style scoped lang="scss">
.button {
  button {
    background: #171717;
    color: white;
    height: 30px;
    padding: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.3s;

    &:hover {
      background: #333333;
    }
  }
}

.classShow {
  width: 100%;
  border: 1px solid #dddddf;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;

  .list {
    color: #171717;

    .item {
      display: flex;
      height: 40px;
      align-items: center;
      border-top: 1px solid #dddddf;
      padding: 0 10px;
      transition: background 0.3s;

      &:hover {
        background: #f9f9f9;
      }
    }
  }
}
</style>
